/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
 * Build: http://www.modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;
window.Modernizr = function (a, b, c) {
    function d(a) {
        r.cssText = a
    }

    function e(a, b) {
        return d(v.join(a + ";") + (b || ""))
    }

    function f(a, b) {
        return typeof a === b
    }

    function g(a, b) {
        return!!~("" + a).indexOf(b)
    }

    function h(a, b) {
        for (var d in a)if (r[a[d]] !== c)return b == "pfx" ? a[d] : !0;
        return!1
    }

    function i(a, b, d) {
        for (var e in a) {
            var g = b[a[e]];
            if (g !== c)return d === !1 ? a[e] : f(g, "function") ? g.bind(d || b) : g
        }
        return!1
    }

    function j(a, b, c) {
        var d = a.charAt(0).toUpperCase() + a.substr(1), e = (a + " " + x.join(d + " ") + d).split(" ");
        return f(b, "string") || f(b, "undefined") ? h(e, b) : (e = (a + " " + y.join(d + " ") + d).split(" "), i(e, b, c))
    }

    function k() {
        m.input = function (c) {
            for (var d = 0, e = c.length; d < e; d++)C[c[d]] = c[d]in s;
            return C.list && (C.list = !!b.createElement("datalist") && !!a.HTMLDataListElement), C
        }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")), m.inputtypes = function (a) {
            for (var d = 0, e, f, g, h = a.length; d < h; d++)s.setAttribute("type", f = a[d]), e = s.type !== "text", e && (s.value = t, s.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(f) && s.style.WebkitAppearance !== c ? (o.appendChild(s), g = b.defaultView, e = g.getComputedStyle && g.getComputedStyle(s, null).WebkitAppearance !== "textfield" && s.offsetHeight !== 0, o.removeChild(s)) : /^(search|tel)$/.test(f) || (/^(url|email)$/.test(f) ? e = s.checkValidity && s.checkValidity() === !1 : /^color$/.test(f) ? (o.appendChild(s), o.offsetWidth, e = s.value != t, o.removeChild(s)) : e = s.value != t)), B[a[d]] = !!e;
            return B
        }("search tel url email datetime date month week time datetime-local number range color".split(" "))
    }

    var l = "2.5.3", m = {}, n = !0, o = b.documentElement, p = "modernizr", q = b.createElement(p), r = q.style, s = b.createElement("input"), t = ":)", u = {}.toString, v = " -webkit- -moz- -o- -ms- ".split(" "), w = "Webkit Moz O ms", x = w.split(" "), y = w.toLowerCase().split(" "), z = {svg:"http://www.w3.org/2000/svg"}, A = {}, B = {}, C = {}, D = [], E = D.slice, F, G = function (a, c, d, e) {
        var f, g, h, i = b.createElement("div"), j = b.body, k = j ? j : b.createElement("body");
        if (parseInt(d, 10))while (d--)h = b.createElement("div"), h.id = e ? e[d] : p + (d + 1), i.appendChild(h);
        return f = ["&#173;", "<style>", a, "</style>"].join(""), i.id = p, k.innerHTML += f, k.appendChild(i), j || (k.style.background = "", o.appendChild(k)), g = c(i, a), j ? i.parentNode.removeChild(i) : k.parentNode.removeChild(k), !!g
    }, H = function (b) {
        var c = a.matchMedia || a.msMatchMedia;
        if (c)return c(b).matches;
        var d;
        return G("@media " + b + " { #" + p + " { position: absolute; } }", function (b) {
            d = (a.getComputedStyle ? getComputedStyle(b, null) : b.currentStyle)["position"] == "absolute"
        }), d
    }, I = function () {
        function a(a, e) {
            e = e || b.createElement(d[a] || "div"), a = "on" + a;
            var g = a in e;
            return g || (e.setAttribute || (e = b.createElement("div")), e.setAttribute && e.removeAttribute && (e.setAttribute(a, ""), g = f(e[a], "function"), f(e[a], "undefined") || (e[a] = c), e.removeAttribute(a))), e = null, g
        }

        var d = {select:"input", change:"input", submit:"form", reset:"form", error:"img", load:"img", abort:"img"};
        return a
    }(), J = {}.hasOwnProperty, K;
    !f(J, "undefined") && !f(J.call, "undefined") ? K = function (a, b) {
        return J.call(a, b)
    } : K = function (a, b) {
        return b in a && f(a.constructor.prototype[b], "undefined")
    }, Function.prototype.bind || (Function.prototype.bind = function (a) {
        var b = this;
        if (typeof b != "function")throw new TypeError;
        var c = E.call(arguments, 1), d = function () {
            if (this instanceof d) {
                var e = function () {
                };
                e.prototype = b.prototype;
                var f = new e, g = b.apply(f, c.concat(E.call(arguments)));
                return Object(g) === g ? g : f
            }
            return b.apply(a, c.concat(E.call(arguments)))
        };
        return d
    });
    var L = function (c, d) {
        var e = c.join(""), f = d.length;
        G(e, function (c, d) {
            var e = b.styleSheets[b.styleSheets.length - 1], g = e ? e.cssRules && e.cssRules[0] ? e.cssRules[0].cssText : e.cssText || "" : "", h = c.childNodes, i = {};
            while (f--)i[h[f].id] = h[f];
            m.touch = "ontouchstart"in a || a.DocumentTouch && b instanceof DocumentTouch || (i.touch && i.touch.offsetTop) === 9, m.csstransforms3d = (i.csstransforms3d && i.csstransforms3d.offsetLeft) === 9 && i.csstransforms3d.offsetHeight === 3, m.generatedcontent = (i.generatedcontent && i.generatedcontent.offsetHeight) >= 1, m.fontface = /src/i.test(g) && g.indexOf(d.split(" ")[0]) === 0
        }, f, d)
    }(['@font-face {font-family:"font";src:url("https://")}', ["@media (", v.join("touch-enabled),("), p, ")", "{#touch{top:9px;position:absolute}}"].join(""), ["@media (", v.join("transform-3d),("), p, ")", "{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join(""), ['#generatedcontent:after{content:"', t, '";visibility:hidden}'].join("")], ["fontface", "touch", "csstransforms3d", "generatedcontent"]);
    A.flexbox = function () {
        return j("flexOrder")
    }, A.canvas = function () {
        var a = b.createElement("canvas");
        return!!a.getContext && !!a.getContext("2d")
    }, A.canvastext = function () {
        return!!m.canvas && !!f(b.createElement("canvas").getContext("2d").fillText, "function")
    }, A.webgl = function () {
        try {
            var d = b.createElement("canvas"), e;
            e = !(!a.WebGLRenderingContext || !d.getContext("experimental-webgl") && !d.getContext("webgl")), d = c
        } catch (f) {
            e = !1
        }
        return e
    }, A.touch = function () {
        return m.touch
    }, A.geolocation = function () {
        return!!navigator.geolocation
    }, A.postmessage = function () {
        return!!a.postMessage
    }, A.websqldatabase = function () {
        return!!a.openDatabase
    }, A.indexedDB = function () {
        return!!j("indexedDB", a)
    }, A.hashchange = function () {
        return I("hashchange", a) && (b.documentMode === c || b.documentMode > 7)
    }, A.history = function () {
        return!!a.history && !!history.pushState
    }, A.draganddrop = function () {
        var a = b.createElement("div");
        return"draggable"in a || "ondragstart"in a && "ondrop"in a
    }, A.websockets = function () {
        for (var b = -1, c = x.length; ++b < c;)if (a[x[b] + "WebSocket"])return!0;
        return"WebSocket"in a
    }, A.rgba = function () {
        return d("background-color:rgba(150,255,150,.5)"), g(r.backgroundColor, "rgba")
    }, A.hsla = function () {
        return d("background-color:hsla(120,40%,100%,.5)"), g(r.backgroundColor, "rgba") || g(r.backgroundColor, "hsla")
    }, A.multiplebgs = function () {
        return d("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(r.background)
    }, A.backgroundsize = function () {
        return j("backgroundSize")
    }, A.borderimage = function () {
        return j("borderImage")
    }, A.borderradius = function () {
        return j("borderRadius")
    }, A.boxshadow = function () {
        return j("boxShadow")
    }, A.textshadow = function () {
        return b.createElement("div").style.textShadow === ""
    }, A.opacity = function () {
        return e("opacity:.55"), /^0.55$/.test(r.opacity)
    }, A.cssanimations = function () {
        return j("animationName")
    }, A.csscolumns = function () {
        return j("columnCount")
    }, A.cssgradients = function () {
        var a = "background-image:", b = "gradient(linear,left top,right bottom,from(#9f9),to(white));", c = "linear-gradient(left top,#9f9, white);";
        return d((a + "-webkit- ".split(" ").join(b + a) + v.join(c + a)).slice(0, -a.length)), g(r.backgroundImage, "gradient")
    }, A.cssreflections = function () {
        return j("boxReflect")
    }, A.csstransforms = function () {
        return!!j("transform")
    }, A.csstransforms3d = function () {
        var a = !!j("perspective");
        return a && "webkitPerspective"in o.style && (a = m.csstransforms3d), a
    }, A.csstransitions = function () {
        return j("transition")
    }, A.fontface = function () {
        return m.fontface
    }, A.generatedcontent = function () {
        return m.generatedcontent
    }, A.video = function () {
        var a = b.createElement("video"), c = !1;
        try {
            if (c = !!a.canPlayType)c = new Boolean(c), c.ogg = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ""), c.h264 = a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ""), c.webm = a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "")
        } catch (d) {
        }
        return c
    }, A.audio = function () {
        var a = b.createElement("audio"), c = !1;
        try {
            if (c = !!a.canPlayType)c = new Boolean(c), c.ogg = a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), c.mp3 = a.canPlayType("audio/mpeg;").replace(/^no$/, ""), c.wav = a.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ""), c.m4a = (a.canPlayType("audio/x-m4a;") || a.canPlayType("audio/aac;")).replace(/^no$/, "")
        } catch (d) {
        }
        return c
    }, A.localstorage = function () {
        try {
            return localStorage.setItem(p, p), localStorage.removeItem(p), !0
        } catch (a) {
            return!1
        }
    }, A.sessionstorage = function () {
        try {
            return sessionStorage.setItem(p, p), sessionStorage.removeItem(p), !0
        } catch (a) {
            return!1
        }
    }, A.webworkers = function () {
        return!!a.Worker
    }, A.applicationcache = function () {
        return!!a.applicationCache
    }, A.svg = function () {
        return!!b.createElementNS && !!b.createElementNS(z.svg, "svg").createSVGRect
    }, A.inlinesvg = function () {
        var a = b.createElement("div");
        return a.innerHTML = "<svg/>", (a.firstChild && a.firstChild.namespaceURI) == z.svg
    }, A.smil = function () {
        return!!b.createElementNS && /SVGAnimate/.test(u.call(b.createElementNS(z.svg, "animate")))
    }, A.svgclippaths = function () {
        return!!b.createElementNS && /SVGClipPath/.test(u.call(b.createElementNS(z.svg, "clipPath")))
    };
    for (var M in A)K(A, M) && (F = M.toLowerCase(), m[F] = A[M](), D.push((m[F] ? "" : "no-") + F));
    return m.input || k(), m.addTest = function (a, b) {
        if (typeof a == "object")for (var d in a)K(a, d) && m.addTest(d, a[d]); else {
            a = a.toLowerCase();
            if (m[a] !== c)return m;
            b = typeof b == "function" ? b() : b, o.className += " " + (b ? "" : "no-") + a, m[a] = b
        }
        return m
    }, d(""), q = s = null, function (a, b) {
        function c(a, b) {
            var c = a.createElement("p"), d = a.getElementsByTagName("head")[0] || a.documentElement;
            return c.innerHTML = "x<style>" + b + "</style>", d.insertBefore(c.lastChild, d.firstChild)
        }

        function d() {
            var a = k.elements;
            return typeof a == "string" ? a.split(" ") : a
        }

        function e(a) {
            var b = {}, c = a.createElement, e = a.createDocumentFragment, f = e();
            a.createElement = function (a) {
                var d = (b[a] || (b[a] = c(a))).cloneNode();
                return k.shivMethods && d.canHaveChildren && !h.test(a) ? f.appendChild(d) : d
            }, a.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + d().join().replace(/\w+/g, function (a) {
                return b[a] = c(a), f.createElement(a), 'c("' + a + '")'
            }) + ");return n}")(k, f)
        }

        function f(a) {
            var b;
            return a.documentShived ? a : (k.shivCSS && !i && (b = !!c(a, "article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")), j || (b = !e(a)), b && (a.documentShived = b), a)
        }

        var g = a.html5 || {}, h = /^<|^(?:button|form|map|select|textarea)$/i, i, j;
        (function () {
            var a = b.createElement("a");
            a.innerHTML = "<xyz></xyz>", i = "hidden"in a, j = a.childNodes.length == 1 || function () {
                try {
                    b.createElement("a")
                } catch (a) {
                    return!0
                }
                var c = b.createDocumentFragment();
                return typeof c.cloneNode == "undefined" || typeof c.createDocumentFragment == "undefined" || typeof c.createElement == "undefined"
            }()
        })();
        var k = {elements:g.elements || "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video", shivCSS:g.shivCSS !== !1, shivMethods:g.shivMethods !== !1, type:"default", shivDocument:f};
        a.html5 = k, f(b)
    }(this, b), m._version = l, m._prefixes = v, m._domPrefixes = y, m._cssomPrefixes = x, m.mq = H, m.hasEvent = I, m.testProp = function (a) {
        return h([a])
    }, m.testAllProps = j, m.testStyles = G, m.prefixed = function (a, b, c) {
        return b ? j(a, b, c) : j(a, "pfx")
    }, o.className = o.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (n ? " js " + D.join(" ") : ""), m
}(this, this.document), function (a, b, c) {
    function d(a) {
        return o.call(a) == "[object Function]"
    }

    function e(a) {
        return typeof a == "string"
    }

    function f() {
    }

    function g(a) {
        return!a || a == "loaded" || a == "complete" || a == "uninitialized"
    }

    function h() {
        var a = p.shift();
        q = 1, a ? a.t ? m(function () {
            (a.t == "c" ? B.injectCss : B.injectJs)(a.s, 0, a.a, a.x, a.e, 1)
        }, 0) : (a(), h()) : q = 0
    }

    function i(a, c, d, e, f, i, j) {
        function k(b) {
            if (!o && g(l.readyState) && (u.r = o = 1, !q && h(), l.onload = l.onreadystatechange = null, b)) {
                a != "img" && m(function () {
                    t.removeChild(l)
                }, 50);
                for (var d in y[c])y[c].hasOwnProperty(d) && y[c][d].onload()
            }
        }

        var j = j || B.errorTimeout, l = {}, o = 0, r = 0, u = {t:d, s:c, e:f, a:i, x:j};
        y[c] === 1 && (r = 1, y[c] = [], l = b.createElement(a)), a == "object" ? l.data = c : (l.src = c, l.type = a), l.width = l.height = "0", l.onerror = l.onload = l.onreadystatechange = function () {
            k.call(this, r)
        }, p.splice(e, 0, u), a != "img" && (r || y[c] === 2 ? (t.insertBefore(l, s ? null : n), m(k, j)) : y[c].push(l))
    }

    function j(a, b, c, d, f) {
        return q = 0, b = b || "j", e(a) ? i(b == "c" ? v : u, a, b, this.i++, c, d, f) : (p.splice(this.i++, 0, a), p.length == 1 && h()), this
    }

    function k() {
        var a = B;
        return a.loader = {load:j, i:0}, a
    }

    var l = b.documentElement, m = a.setTimeout, n = b.getElementsByTagName("script")[0], o = {}.toString, p = [], q = 0, r = "MozAppearance"in l.style, s = r && !!b.createRange().compareNode, t = s ? l : n.parentNode, l = a.opera && o.call(a.opera) == "[object Opera]", l = !!b.attachEvent && !l, u = r ? "object" : l ? "script" : "img", v = l ? "script" : u, w = Array.isArray || function (a) {
        return o.call(a) == "[object Array]"
    }, x = [], y = {}, z = {timeout:function (a, b) {
        return b.length && (a.timeout = b[0]), a
    }}, A, B;
    B = function (a) {
        function b(a) {
            var a = a.split("!"), b = x.length, c = a.pop(), d = a.length, c = {url:c, origUrl:c, prefixes:a}, e, f, g;
            for (f = 0; f < d; f++)g = a[f].split("="), (e = z[g.shift()]) && (c = e(c, g));
            for (f = 0; f < b; f++)c = x[f](c);
            return c
        }

        function g(a, e, f, g, i) {
            var j = b(a), l = j.autoCallback;
            j.url.split(".").pop().split("?").shift(), j.bypass || (e && (e = d(e) ? e : e[a] || e[g] || e[a.split("/").pop().split("?")[0]] || h), j.instead ? j.instead(a, e, f, g, i) : (y[j.url] ? j.noexec = !0 : y[j.url] = 1, f.load(j.url, j.forceCSS || !j.forceJS && "css" == j.url.split(".").pop().split("?").shift() ? "c" : c, j.noexec, j.attrs, j.timeout), (d(e) || d(l)) && f.load(function () {
                k(), e && e(j.origUrl, i, g), l && l(j.origUrl, i, g), y[j.url] = 2
            })))
        }

        function i(a, b) {
            function c(a, c) {
                if (a) {
                    if (e(a))c || (j = function () {
                        var a = [].slice.call(arguments);
                        k.apply(this, a), l()
                    }), g(a, j, b, 0, h); else if (Object(a) === a)for (n in m = function () {
                        var b = 0, c;
                        for (c in a)a.hasOwnProperty(c) && b++;
                        return b
                    }(), a)a.hasOwnProperty(n) && (!c && !--m && (d(j) ? j = function () {
                        var a = [].slice.call(arguments);
                        k.apply(this, a), l()
                    } : j[n] = function (a) {
                        return function () {
                            var b = [].slice.call(arguments);
                            a && a.apply(this, b), l()
                        }
                    }(k[n])), g(a[n], j, b, n, h))
                } else!c && l()
            }

            var h = !!a.test, i = a.load || a.both, j = a.callback || f, k = j, l = a.complete || f, m, n;
            c(h ? a.yep : a.nope, !!i), i && c(i)
        }

        var j, l, m = this.yepnope.loader;
        if (e(a))g(a, 0, m, 0); else if (w(a))for (j = 0; j < a.length; j++)l = a[j], e(l) ? g(l, 0, m, 0) : w(l) ? B(l) : Object(l) === l && i(l, m); else Object(a) === a && i(a, m)
    }, B.addPrefix = function (a, b) {
        z[a] = b
    }, B.addFilter = function (a) {
        x.push(a)
    }, B.errorTimeout = 1e4, b.readyState == null && b.addEventListener && (b.readyState = "loading", b.addEventListener("DOMContentLoaded", A = function () {
        b.removeEventListener("DOMContentLoaded", A, 0), b.readyState = "complete"
    }, 0)), a.yepnope = k(), a.yepnope.executeStack = h, a.yepnope.injectJs = function (a, c, d, e, i, j) {
        var k = b.createElement("script"), l, o, e = e || B.errorTimeout;
        k.src = a;
        for (o in d)k.setAttribute(o, d[o]);
        c = j ? h : c || f, k.onreadystatechange = k.onload = function () {
            !l && g(k.readyState) && (l = 1, c(), k.onload = k.onreadystatechange = null)
        }, m(function () {
            l || (l = 1, c(1))
        }, e), i ? k.onload() : n.parentNode.insertBefore(k, n)
    }, a.yepnope.injectCss = function (a, c, d, e, g, i) {
        var e = b.createElement("link"), j, c = i ? h : c || f;
        e.href = a, e.rel = "stylesheet", e.type = "text/css";
        for (j in d)e.setAttribute(j, d[j]);
        g || (n.parentNode.insertBefore(e, n), m(c, 0))
    }
}(this, document), Modernizr.load = function () {
    yepnope.apply(window, [].slice.call(arguments, 0))
}

/*
 * New test for browser's ability to overflow scroll. Older iOS devices won't scroll on absolute divs properly.
 * Want to deploy iscroll when not detected.
 */
Modernizr.addTest("overflowscrolling", function () {
    return Modernizr.testAllProps("overflowScrolling");
});

var dashboardSlider;

Modernizr.load([
    /*
     * SwipeJS Code
     */
    {
        load:'../assets/js/idox/swipe.orig.js',
        callback:function (url, result, key) {

            /* Small Widget Sliders */
            $('.widget').each(function () {
                new Swipe(document.getElementById($(this).attr('id')));
            });

            /* Dashboard Slider */
            dashboardSlider = new Swipe(
                document.getElementById('dashboard'), {
                    callback:function (e, pos) {
                        //  $('#app-body').scrollTop(0);    /* REMOVED causes irrelevant scrolltops when img:hover */

                        removeActive();
                        $('#dashboard-slider-tabs li[tabIndex="' + pos + '"]').addClass('active');

                    }
                }
            );

            /* Keep track of active page */
            $('#dashboard-slider-tabs li').click(function () {
                var tabIndex = $(this).attr('tabindex');
                var currentPos = dashboardSlider.getPos();

                if (currentPos != tabIndex) {
                    removeActive();
                    $(this).addClass('active');

                    dashboardSlider.slide(tabIndex, 200);
                }
            });

            $('.btn-prev').click(function () {
                removeActive();
                dashboardSlider.prev();
                $('#dashboard-slider-tabs li[tabIndex="' + dashboardSlider.getPos() + '"]').addClass('active');
            });

            $('.btn-next').click(function () {
                removeActive();
                dashboardSlider.next();
                $('#dashboard-slider-tabs li[tabIndex="' + dashboardSlider.getPos() + '"]').addClass('active');
            });

            /* remove a*/
            function removeActive() {
                $('#dashboard-slider-tabs .active').removeClass('active');
            }

        }// end callback
    },


    /*
     * General JS
     */
    { load:{
        'bootstrapjs':'../assets/js/bootstrap-modal.js',
        'idoxjs':'../assets/js/idox/js.js',
        'elasticjs':'../assets/js/idox/elastic.js'
    },

        complete:function (url, result, key) {
            $('#message-reply-field').elastic();

        }

    },

    /* supports touch events and doesn't support overflow scrolling ( eg. iOS < 5 ) needs iScroll*/
    {
        test:(!Modernizr.overflowscrolling && Modernizr.touch),
        yep:{ 'iscroll':'../assets/js/idox/iscroll.js'},

        callback:{'iscroll':function (url, result, key) {

            alert('iscroll');

            document.addEventListener('touchmove', function (e) {
                e.preventDefault();
            }, false);

            new iScroll('app-body'), {
                hScroll:false,
                lockDirection:true
            };


            var msgScroll = new iScroll('messages-wrapper', {
                onBeforeScrollStart:function (e) {
                    setTimeout(function () {
                        msgScroll.refresh();
                    }, 0);
                }
            });


            new iScroll('advanced-search', {
                useTransform:false,

                /* special options for forms */
                onBeforeScrollStart:function (e) {
                    var target = e.target;
                    while (target.nodeType != 1) target = target.parentNode;

                    if (target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA' && target.tagName != 'OPTION')
                        e.preventDefault();
                }
            });

        }
        }


    },
    /*
     * Touch devices get the fast touch treatment.
     * For fast tapping events. Touch test only detects whether browser supports touch events
     * Doesn't necessarily detect devices.
     *
     * See for support:
     * http://modernizr.github.com/Modernizr/touch.html
     */
    {
        test:Modernizr.touch,
        yep:{
            'fastclick':'../assets/js/idox/assanka.fastclick.min.js',
            'touchwipe':'../assets/js/idox/touchwipe.js'
        },

        callback:{

            'fastclick':function (url, result, key) {
                new FastClick(document.body);
                // alert('loaded fastclick');
            },


            'touchwipe':function (url, result, key) {


                $("#messages-window").touchwipe({
                    wipeRight:function () {
                        toggleMessages();
                        $('#messages-button').removeClass('pressed active');
                    },
                    min_move_x:20,
                    min_move_y:20,
                    preventDefaultEvents:false
                });


                $("#profile").touchwipe({
                    wipeLeft:function () {
                        $("#profile").addClass('stage-left');
                        $('#profile-button').removeClass('pressed active');
                    },
                    min_move_x:20,
                    min_move_y:20,
                    preventDefaultEvents:false
                });

                //  alert('loaded touchwipe');
            }
        }


    }// touch test

]);//end modern.load


